package com.winter.controller;

import com.winter.model.Users;
import com.winter.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/index")
    public String index(Model model){
        List<Users> users= userService.findAll();
        model.addAttribute("user",users);
        return "index";
    }
    @RequestMapping("/regeist")
    public String redeist(){
        return "regeist";
    }
}
